﻿@model OnlineShop.Models.RegisterModel
@using BotDetect.Web.UI.Mvc;
<link href="@BotDetect.Web.CaptchaUrls.Absolute.LayoutStyleSheetUrl"
      rel="stylesheet" type="text/css" />
@{ MvcCaptcha registerCapcha = new MvcCaptcha("registerCapcha"); }

@{
    ViewBag.Title = "Đăng ký";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section jsFooter{

    <script src="/assets/client/js/controller/userController.js"></script>
}
<div class="content">
    @using (Html.BeginForm("Register", "User", FormMethod.Post))
    {
        @Html.AntiForgeryToken()

        <div class="form-horizontal">
            <h4>Đăng ký thành viên</h4>
            <hr />
            <div class="form-group">
                @Html.ValidationSummary(false, "", new { @class = "text-danger" })
                @if (ViewBag.Success != null)
                {
                    <div class="alert alert-success">@ViewBag.Success</div>
                }
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.UserName, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.UserName, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.UserName, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Password, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.PasswordFor(model => model.Password, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.ConfirmPassword, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.ConfirmPassword, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Address, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextAreaFor(model => model.Address, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Address, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.Email, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Phone, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.Phone, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Phone, "", new { @class = "text-danger" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.ProvinceID, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.DropDownList("ProvinceID", new SelectList(new string[] { }), new { @class = "form-control", @id = "ddlProvince" })
                    @Html.ValidationMessageFor(model => model.ProvinceID, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.DistrictID, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.DropDownList("DistrictID", new SelectList(new string[] { }), new { @class = "form-control", @id = "ddlDistrict" })
                    @Html.ValidationMessageFor(model => model.DistrictID, "", new { @class = "text-danger" })
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    @Html.Captcha(registerCapcha)
                    @Html.TextBox("CaptchaCode")
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="Đăng ký" class="btn btn-default" />
                </div>
            </div>
        </div>
    }
</div>
